/**
 * Created by Administrator on 2017/12/8 0008.
 */
import jsonp from 'common/js/jsonp'
import { commonParams, options } from './config'
import axios from 'axios'
// import qs from 'qs'
export function getDiscList (page) {
  const url = '/api/user/all/' + (page ? page.currentPage : 1) + '/' + (page ? page.limit : 5)
  const data = Object.assign({}, commonParams, {
    rnd: Math.random(),
    format: 'json'
  })
  /* var instance = axios.create({
   headers: {'content-type': 'application/x-www-form-urlencoded'}
   }) */
  return axios.get(url, {
    params: data
  }).then((res) => {
    return Promise.resolve(res)
  })
}

export function getSongList (disstid) {
  const url = '/user/all/2/5'

  const data = Object.assign({}, commonParams, {
    disstid
  })
  return jsonp(url, data, options)
}
